﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace BlogHunter
{
    [Serializable]
    public class BlogInfo
    {
        private string _articleTitle;

        [XmlElement("ArticleTitle")]
        public string ArticleTitle
        {
            get { return _articleTitle; }
            set { _articleTitle = value; }
        }

        private string _articleLink;

        [XmlElement("ArticleLink")]
        public string ArticleLink
        {
            get { return _articleLink; }
            set { _articleLink = value; }
        }

        private DateTime _articleDateTime;

        [XmlElement("ArticleDateTime")]
        public DateTime ArticleDateTime
        {
            get { return _articleDateTime; }
            set { _articleDateTime = value; }
        }

        public override bool Equals(System.Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return false;
            }

            // If parameter cannot be cast to Point return false.
            BlogInfo p = obj as BlogInfo;
            if ((System.Object)p == null)
            {
                return false;
            }

            // Return true if the fields match:
            return (ArticleLink == p.ArticleLink);
        }

        public override int GetHashCode()
        {
            return (this.ArticleTitle.GetHashCode() ^ this.ArticleLink.GetHashCode());
        }

    }
}
